<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<%@ taglib prefix="ta" tagdir="/WEB-INF/tags/tatags" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>接入系统管理页面</title>
    <%@ include file="/ta/inc.jsp" %>
</head>
<body class="no-scrollbar">
<ta:pageloading/>
<ta:panel key="查询条件" cols="3" id="params">
    <ta:text id="systemid" key="接入系统ID"/>
    <ta:text id="systemname" key="接入系统名称"/>
    <ta:buttonLayout>
        <ta:button id="qry" isok="true" key="查询" onClick="fnQuery()"/>
        <ta:button id="clear" key="清空" onClick="fnClear()"/>
    </ta:buttonLayout>
</ta:panel>
<%--headerButton="[{'id':'btn-n','name':'新增','click':'fnAdd()'}]"--%>
<ta:panel key="接入系统列表" withToolBar="true" fit="true">
    <ta:panelToolBar>
        <ta:button id="btnAdd" key="新增[A]" hotKey="a" icon="icon-add" isShowIcon="true" asToolBarItem="true"
                   onClick="fnAdd();"/>
    </ta:panelToolBar>
    <ta:datagrid id="grid1" height="300" forceFitColumns="true">
        <ta:datagridItem id="id" key="ID" hiddenColumn="true"/>
        <ta:datagridItem id="systemid" key="接入系统ID"/>
        <ta:datagridItem id="systemname" key="接入系统名称"/>
        <%--<ta:datagridItem id="userid" key="负责人ID"/>--%>
        <ta:datagridItem id="username" key="负责人"/>
        <ta:datagridItem id="senderTypeOrder" key="渠道优先级"/>
        <ta:datagridItem id="senderTypeOrderDesc" key="渠道优先级"/>
        <ta:datagridItem id="ticket" key="证书" showDetailed="true"/>
        <ta:datagridItemOperate showAll="true" id="nm" name="操作">
            <ta:datagridItemOperateMenu icon="" name="编辑" click="fnEdit"/>
            <ta:datagridItemOperateMenu icon="" name="删除" click="fnRemove"/>
        </ta:datagridItemOperate>
        <ta:dataGridToolPaging url="getList.do"></ta:dataGridToolPaging>
    </ta:datagrid>
</ta:panel>
</body>
</html>
<script type="text/javascript">
    $(document).ready(function () {
        $("body").taLayout();
        fnQuery();

    });
    function fnClear() {
        Base.setValue("systemid", "");
        Base.setValue("systemname", "");
    }
    function fnQuery() {
        Base.submit("params,grid1", "getList.do");
    }
    function fnAdd() {
        Base.openWindow("add", "新增接入系统", "<%=basePath%>sysAppManage/toNew.do", null, 400, 350, null, fnQuery, true, "", null);
    }
    function fnEdit(data) {
        var id = data.id;
        Base.openWindow("edit", "修改接入系统", "<%=basePath%>sysAppManage/toEdit.do?id=" + id, null, 400, 350, null, fnQuery, true, "", null);
    }
    function fnRemove(data) {
        var id = data.id;
        Base.confirm("确定删除该数据？", function (yes) {
            if (yes) {
                Base.submit("", "<%=basePath%>sysAppManage/drop.do?id=" + id, null, "", false, function (data) {
                    if (data.success) {
                        Base.msgTopTip("删除成功！");
                        fnQuery();
                    } else {
                        Base.alert("删除失败！", "error");
                    }
                });
            }
        })
    }

</script>
<%@ include file="/ta/incfooter.jsp" %>